package com.gaojiabao.panghu.controller;

import com.gaojiabao.panghu.service.UploadService;
import com.gaojiabao.panghu.utils.Result;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author: gaojiabao
 * @Date: 2024/11/5 17:06
 */
@RestController
@RequestMapping("/panghu")
public class UploadController {
    @Resource
    private UploadService uploadService;

    /**
     * 文件上传
     * /panghu/upload
     *
     * @param multipartFile 文件上传的接口
     */

    @PostMapping("/upload")
    public Result<?> upload(@RequestParam("file") MultipartFile multipartFile) {
        return uploadService.upload(multipartFile);
    }
}
